//公共引用
import React from "react";
import "./assets/css/style.less";
import { Route, Redirect, HashRouter as Router } from "react-router-dom";
import { observer } from "mobx-react";
//次级组件引用
import { ConfigProvider } from "antd";
// import enUS from "antd/lib/locale/en_US";
// 由于 antd 组件的默认文案是英文，所以需要修改为中文
import zhCN from "antd/lib/locale/zh_CN";
import Home from "./pages/Layout/Home";
import Login from "./pages/Login";

import "moment/locale/zh-cn";
// import { WebVariable } from "./data/WebVariable";
import { LanguageSettings } from "./i18n/LanguageSettings";
// import { AvailableLanguage } from "./i18n/AvailableLanguage";
//自定义组件及公共方法引用

@observer
class App extends React.Component {
  render() {
    return (
      <ConfigProvider locale={zhCN}>
        <Router>
          <Route path="/Portal" component={Home} />
          <Route exact path="/Login" component={Login} />
          <Route path="/" exact component={() => <Redirect to={"Login"} />} />
        </Router>
      </ConfigProvider>
    );
  }
  async componentDidMount() {
    await LanguageSettings.load();
    // await LanguageSettings.setLanguage(AvailableLanguage["en-us"]);
  }
  // 读取配置文件
  // private async loadSettings() {}
}

export default App;
